import axios from '@/libs/api.request'
import { getToken } from '@/libs/util'
// =============== news-system/advertisements/list.vue =========================
let auth_token = getToken();
//车主
export const getTableData = (page_current, page_size, searchData) => {
  return axios.request({
    url: 'api/v1.cuser.car_user/index',
    params: {
      page_current: page_current,
      page_size: page_size,
      auth_token:auth_token,
    },
    method: 'get'
  })
}

////筛选数据
//export const getData = () => {
//return axios.request({
//  url: 'api/cuser.car/get_data',
//  params: {
//    auth_token:auth_token,
//  },
//  method: 'get'
//})
//}



export const addCarUser = (formData) => {
  formData.auth_token = auth_token;
  return axios.request({
    url: 'api/v1.cuser.car_user/create',
    data:formData,
    method: 'post'
  })
}

export const editCarUser = (formData) => {
  formData.auth_token = auth_token;
  return axios.request({
    url: 'api/v1.cuser.car_user/car_user_update',
    data:formData,
    method: 'post'
  })
}

export const getInfo = (c_user_id) => {
  return axios.request({
    url: 'api/v1.cuser.car_user/car_user_read',
    params: {
      c_user_id: c_user_id,
      auth_token:auth_token,
    },
    method: 'get'
  })
}
